#include "OrQuery.h"
#include "QueryResult.h"

QueryResult OrQuery::eval(const TextQuery& text) const{
    QueryResult left = lhs.eval(text), right = rhs.eval(text);
    auto ret_idxs = make_shared<std::set<int>>(left.begin(),left.end());
    ret_idxs->insert(right.begin(),right.end());
    return QueryResult(rep(),ret_idxs,left.get_file());
}